home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / cert_advisories / CA-92:11:SunOS.Environment.vulnerability < prev    next >
Encoding:
Text File  |  1992-05-26  |  6.3 KB  |  150 lines

  1. ===========================================================================
  2. CA-92:11                        CERT Advisory
  3.                                 May 27, 1992
  4.              SunOS Environment Variables and setuid/setgid Vulnerability
  5. ---------------------------------------------------------------------------
  6.  
  7. The Computer Emergency Response Team/Coordination Center (CERT/CC) has
  8. received information concerning a vulnerability involving environment
  9. variables and setuid/setgid programs under Sun Microsystems Computer
  10. Corporation SunOS.  This vulnerability exists on all Sun architectures
  11. running SunOS 4.0 and higher.
  12.  
  13. In-house and third-party software can also be impacted by this
  14. vulnerability.  For example, the current versions of rnews, sudo,
  15. smount, and npasswd are known to be vulnerable under SunOS.  See the
  16. Description section of this advisory for details of how to identify
  17. software which may be vulnerable.
  18.  
  19. The workaround detailed in this advisory can be used to protect
  20. vulnerable software on SunOS operating system versions for which
  21. patches are unavailable, or for local or third party software which
  22. may be vulnerable.
  23.  
  24. Sun has provided patches for SunOS 4.1, 4.1.1, and 4.1.2 programs
  25. which are known to be impacted by this vulnerability.  They are
  26. available through your local Sun Answer Center as well as through
  27. anonymous ftp from the ftp.uu.net (137.39.1.9) system in the
  28. /systems/sun/sun-dist directory.
  29.  
  30. Fix                     PatchID        Filename            Checksum
  31. login and su            100630-01      100630-01.tar.Z     36269    39
  32. sendmail                100377-04      100377-04.tar.Z     14692   311
  33.  
  34. Note: PatchID 100630-01 contains the international version of
  35. /usr/bin/login.  PatchID 100631-01 contains the domestic version
  36. of /usr/bin/login and is only available from Sun Answer Centers for
  37. sites that use the US Encryption Kit.
  38.  
  39. Please note that Sun will occasionally update patch files.  If you
  40. find that the checksum is different please contact Sun or the CERT/CC
  41. for verification.
  42.  
  43. ---------------------------------------------------------------------------
  44.  
  45. I.   Description
  46.  
  47.      A security vulnerability exists if a set-user-id program changes
  48.      its real and effective user ids to be the same (but not to the
  49.      invoker's id), and subsequently causes a dynamically-linked program 
  50.      to be exec'd.  A similar vulnerability exists for set-group-id programs.
  51.  
  52.      In particular, SunOS /usr/lib/sendmail, /usr/bin/login,
  53.      /usr/bin/su, and /usr/5bin/su are vulnerable to this problem.
  54.  
  55. II.  Impact
  56.  
  57.      Local users can gain unauthorized privileged access to the system.
  58.  
  59. III. Solution
  60.         
  61.      A.  Obtain and install the patches from Sun or from ftp.uu.net following 
  62.          the provided instructions.
  63.  
  64.      B.  The following workaround can be used to protect vulnerable binaries
  65.          for which patches are unavailable for your SunOS version,
  66.          or for local or third party software which may be vulnerable. 
  67.          The example given is a workaround for /usr/lib/sendmail.  
  68.  
  69.          1.  As root, rename the existing version of /usr/lib/sendmail
  70.              and modify the permissions to prevent misuse.
  71.  
  72.              # mv /usr/lib/sendmail /usr/lib/sendmail.dist
  73.              # chmod 755 /usr/lib/sendmail.dist
  74.  
  75.          2.  In an empty temporary directory, create a file wrapper.c
  76.              containing the following C program source (remember to
  77.              strip any leading white-space characters from the #define lines).
  78.  
  79.              /* Start of C program source */
  80.  
  81.              /* Change the next line to reflect the full pathname
  82.                 of the file to be protected by the wrapper code   */
  83.  
  84.              #define COMMAND "/usr/lib/sendmail.dist"
  85.              #define VAR_NAME "LD_"
  86.  
  87.              main(argc,argv,envp)
  88.              int argc;
  89.              char **argv;
  90.              char **envp;
  91.              {
  92.                      register char  **cpp;
  93.                      register char  **xpp;
  94.                      register char   *cp;
  95.  
  96.                      for (cpp = envp; cp = *cpp;) {
  97.                              if (strncmp(cp, VAR_NAME, strlen(VAR_NAME))==0) {
  98.                                      for (xpp = cpp; xpp[0] = xpp[1]; xpp++);
  99.                                      /* void */ ;
  100.                              }
  101.                              else {
  102.                                      cpp++;
  103.                              }
  104.                      }
  105.  
  106.                      execv(COMMAND, argv);
  107.                      perror(COMMAND);
  108.                      exit(1);
  109.              }
  110.              /* End of C program source */
  111.  
  112.          3.  As root, compile the C program source for the wrapper and
  113.              install the resulting binary.
  114.  
  115.              # make wrapper
  116.              # mv ./wrapper /usr/lib/sendmail
  117.              # chown root /usr/lib/sendmail
  118.              # chmod 4711 /usr/lib/sendmail
  119.  
  120.          4.  Steps 1 through 3 should be repeated for other vulnerable
  121.              programs with the appropriate substitution of pathnames and file
  122.              names. The "COMMAND" C preprocessor variable within the C program
  123.              source should also be changed to reflect the appropriate renamed
  124.              system binary.
  125.  
  126. ---------------------------------------------------------------------------
  127. The CERT/CC wishes to thank the following for their assistance: CIAC,
  128. PCERT, and in particular Wietse Venema of Eindhoven University, The
  129. Netherlands, for his support in the analysis of and a workaround for
  130. this problem.  We also wish to thank Sun Microsystems Computer
  131. Corporation for their prompt response to this vulnerability.
  132. ---------------------------------------------------------------------------
  133.  
  134. If you believe that your system has been compromised, contact CERT/CC or
  135. your representative in FIRST (Forum of Incident Response and Security Teams).
  136.  
  137. Internet E-mail: cert@cert.org
  138. Telephone: 412-268-7090 (24-hour hotline)
  139.            CERT/CC personnel answer 7:30 a.m.-6:00 p.m. EST(GMT-5)/EDT(GMT-4),
  140.            on call for emergencies during other hours.
  141.  
  142. Computer Emergency Response Team/Coordination Center (CERT/CC)
  143. Software Engineering Institute
  144. Carnegie Mellon University
  145. Pittsburgh, PA 15213-3890
  146.  
  147. Past advisories, information about FIRST representatives, and other
  148. information related to computer security are available for anonymous ftp
  149. from cert.org (192.88.209.5).
  150.